package com.bootdo.common.domain;/**
 * @author jafar.tang
 * @date 2018/10/11 11:39
 * @description
 */


import java.lang.reflect.InvocationTargetException;

/**
 * Created on 2018/10/11.
 * Description:
 * Copyright (c) 2018, 成都冰鉴信息科技有限公司
 * All rights reserved.
 *
 * @author jafar.tang
 */
public class AssistantEnumVO {
    private String key;
    private String title;
    private Object[] values;

    public static AssistantEnumVO ok(String key, String title, Object[] values) {
        return new AssistantEnumVO(key, title, values);
    }

    public static AssistantEnumVO ok(String title, Class clazz) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        String key = clazz.getName();
        Object values = clazz.getDeclaredMethod("values").invoke(null);
        return new AssistantEnumVO(key, title, (Object[]) values);
    }

    public AssistantEnumVO() {
    }

    public AssistantEnumVO(String key, String title, Object[] values) {
        this.key = key;
        this.title = title;
        this.values = values;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Object[] getValues() {
        return values;
    }

    public void setValues(Object[] values) {
        this.values = values;
    }
}
